//
// CVertexStreamManager.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CVertexStreamManager {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CVertexStreamManager(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CVertexStreamManager obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CVertexStreamManager(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CVertexStreamManager() {
    this(nel3dJNI.new_CVertexStreamManager(), true);
  }

  public void init(IDriver driver, long vertexFormat, long maxVertices, long numVBHard, String vbName, boolean allowVolatileVertexBuffer) {
    nel3dJNI.CVertexStreamManager_init__SWIG_0(swigCPtr, this, IDriver.getCPtr(driver), driver, vertexFormat, maxVertices, numVBHard, vbName, allowVolatileVertexBuffer);
  }

  public void init(IDriver driver, long vertexFormat, long maxVertices, long numVBHard, String vbName) {
    nel3dJNI.CVertexStreamManager_init__SWIG_1(swigCPtr, this, IDriver.getCPtr(driver), driver, vertexFormat, maxVertices, numVBHard, vbName);
  }

  public void release() {
    nel3dJNI.CVertexStreamManager_release(swigCPtr, this);
  }

  public long getNumVB() {
    return nel3dJNI.CVertexStreamManager_getNumVB(swigCPtr, this);
  }

  public IDriver getDriver() {
    long cPtr = nel3dJNI.CVertexStreamManager_getDriver(swigCPtr, this);
    return (cPtr == 0) ? null : new IDriver(cPtr, false);
  }

  public long getVertexFormat() {
    return nel3dJNI.CVertexStreamManager_getVertexFormat(swigCPtr, this);
  }

  public long getVertexSize() {
    return nel3dJNI.CVertexStreamManager_getVertexSize(swigCPtr, this);
  }

  public long getMaxVertices() {
    return nel3dJNI.CVertexStreamManager_getMaxVertices(swigCPtr, this);
  }

  public SWIGTYPE_p_unsigned_char lock() {
    long cPtr = nel3dJNI.CVertexStreamManager_lock(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
  }

  public void unlock(long numVertices) {
    nel3dJNI.CVertexStreamManager_unlock(swigCPtr, this, numVertices);
  }

  public void activate() {
    nel3dJNI.CVertexStreamManager_activate(swigCPtr, this);
  }

  public boolean isBRGA() {
    return nel3dJNI.CVertexStreamManager_isBRGA(swigCPtr, this);
  }

  public void swapVBHard() {
    nel3dJNI.CVertexStreamManager_swapVBHard(swigCPtr, this);
  }

}
